<%--
  Created by IntelliJ IDEA.
  User: dzw
  Date: 2018/3/15
  Time: 17:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<ul class="nav nav-tabs">
  <c:forEach items="${streetList}" var="street" varStatus="index">
    <li class="<c:if test="${street.id==selectStreetId}">active</c:if>"><a href="#es${index.index}" id="estab${index.index}" data-toggle="tab" onclick="toEduStreet('${street.id}')">${street.name}</a></li>
  </c:forEach>
</ul>

<table class="table table-bordered table-condensed">
  <thead>
  <tr>
    <th colspan="2">统计项</th>
    <th>人数</th>
    <th>比例</th>
  </tr>
  </thead>
  <tbody>
  <tr>
    <td rowspan="3"><a href="javascript:void(0)" onclick="toStatistics5('ageAll','${selectStreetId}')">年龄性别 - 街道</a></td>
    <td><a href="javascript:void(0)" onclick="toStatistics5('ageAll','${selectStreetId}')">男</a></td>
    <td class="text-right"><a href="javascript:void(0)" onclick="toStatistics5('ageAll','${selectStreetId}')">${nan0}</a></td>
    <td class="text-right"><a href="javascript:void(0)" onclick="toStatistics5('ageAll','${selectStreetId}')">${nan0Bili}</a></td>
  </tr>
  <tr>
    <td><a href="javascript:void(0)" onclick="toStatistics5('ageAll','${selectStreetId}')">女</a></td>
    <td class="text-right"><a href="javascript:void(0)" onclick="toStatistics5('ageAll','${selectStreetId}')">${nv0}</a></td>
    <td class="text-right"><a href="javascript:void(0)" onclick="toStatistics5('ageAll','${selectStreetId}')">${nv0Bili}</a></td>
  </tr>
  <tr>
    <td><a href="javascript:void(0)" onclick="toStatistics5('ageAll','${selectStreetId}')">平均年龄</a></td>
    <td class="text-right"><a href="javascript:void(0)" onclick="toStatistics5('ageAll','${selectStreetId}')">${avgAge0}</a></td>
    <td class="text-right"><a href="javascript:void(0)" onclick="toStatistics5('ageAll','${selectStreetId}')">&nbsp;</a></td>
  </tr>

  </tbody>
</table>

<script>

  function toEduStreet(streetId){
    if(streetId!="" || streetId!=null){
      $("#tab5").attr("data-streetId", streetId);
      loadURL("<%=path%>/com/director/ageAll?streetId="+streetId,$("#s5"))
    }else{
      __toastr_error("未找到此街道的ID");
    }
  }

  //进入统计图页面
  function toStatistics5(urlName,streetId){
    if(streetId!="" && streetId)
      loadURL("<%=path%>/com/dirStat/"+urlName+"?streetId="+streetId,$("#s5"));
  }

</script>